//
//  MoodDialogView.swift
//  imprint
//
//  Created by 小柠檬🍋 on 2025/2/14.
//

import SwiftUI
//心情弹窗
struct MoodDialogView: View {
    let onDismiss: (Int) -> Void

    var body: some View {
        PopupBottomView(title: "请选择心情") {
            HStack{
                Image(MoodExt.getMoodRes(IMoodType.GREEN.rawValue))
                    .resizable()
                    .frame(width: 50, height: 50)
                    .contentShape(Rectangle())
                    .onTapGesture {
                        onDismiss(IMoodType.GREEN.rawValue)
                    }
                Spacer()
                Image(MoodExt.getMoodRes(IMoodType.RED.rawValue))
                    .resizable()
                    .frame(width: 50, height: 50)
                    .contentShape(Rectangle())
                    .onTapGesture {
                        onDismiss(IMoodType.RED.rawValue)
                    }
                Spacer()
                Image(MoodExt.getMoodRes(IMoodType.YELLOW.rawValue))
                    .resizable()
                    .frame(width: 50, height: 50)
                    .contentShape(Rectangle())
                    .onTapGesture {
                        onDismiss(IMoodType.YELLOW.rawValue)
                    }
                Spacer()
                Image(MoodExt.getMoodRes(IMoodType.BLUE.rawValue))
                    .resizable()
                    .frame(width: 50, height: 50)
                    .contentShape(Rectangle())
                    .onTapGesture {
                        onDismiss(IMoodType.BLUE.rawValue)
                    }
            }.frame(maxWidth: .infinity, minHeight: 200)
        }
    }
}

#Preview {
    MoodDialogView(){ mood in }
}
